package edu.gatech.stolen.tea.display.item;

import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapController;
import com.google.android.maps.MapView;
import android.view.KeyEvent;

import edu.gatech.stolen.tea.R;
//import android.app.Activity;
import android.os.Bundle;

public class MapDisplayActivity extends MapActivity{
	MapView mapView;
	MapController mc;
	GeoPoint p;
	@Override
	public void onCreate(Bundle savedInstanceState){
		super.onCreate(savedInstanceState);
		setContentView(R.layout.viewmap);
		mapView=(MapView)findViewById(R.id.mapview);
		mapView.setBuiltInZoomControls(true);
		mapView.setSatellite(true);
		mc=mapView.getController();
		String coordinates[]={"33.7713203430176","-84.3944091796875"};
		double lat = Double.parseDouble(coordinates[0]);
		double lng = Double.parseDouble(coordinates[1]);
		p=new GeoPoint((int)(lat*1E6),(int)(lng*1E6));
		mc.animateTo(p);
		mc.setZoom(17);
		mapView.invalidate();
	}
	
	public boolean onKeyDown(int keyCode, KeyEvent event){
		switch(keyCode){
		case KeyEvent.KEYCODE_3:
			mc.zoomIn();
			break;
		case KeyEvent.KEYCODE_1:
			mc.zoomOut();
			break;
		}
		return super.onKeyDown(keyCode, event);
		
	}
	@Override
	protected boolean isRouteDisplayed() {
		// TODO Auto-generated method stub
		return false;
	}
	
}
